Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#6641] fix(core): Possible error in the equals method for collection #6644

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

sunxiaojian
Copy link
Collaborator

What changes were proposed in this pull request?

Possible error in the equals method for collection

Why are the changes needed?

Fix: #6641

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

N/A

@yuqi1129
Copy link
Contributor

@sunxiaojian , Can you please check all places in the project and fix them all, these two places are just examples.

@sunxiaojian
Copy link
Collaborator Author

@sunxiaojian , Can you please check all places in the project and fix them all, these two places are just examples.

ok, I checked. I'll double-check again.

@yuqi1129
Copy link
Contributor

@sunxiaojian , Can you please check all places in the project and fix them all, these two places are just examples.

ok, I checked. I'll double-check again.

At least TableEntity should be in the change list.

@sunxiaojian sunxiaojian force-pushed the fixed-6641 branch 2 times, most recently from 7cbdab7 to 02c1614 Compare March 10, 2025 04:08
@sunxiaojian
Copy link
Collaborator Author

@sunxiaojian , Can you please check all places in the project and fix them all, these two places are just examples.

ok, I checked. I'll double-check again.

At least TableEntity should be in the change list.

fixed

yuqi1129
yuqi1129 previously approved these changes Mar 10, 2025
Copy link
Contributor

@yuqi1129 yuqi1129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yuqi1129
Copy link
Contributor

@jerqi Would you like to take a look?

@jerqi
Copy link
Contributor

jerqi commented Mar 10, 2025

Member

Actually I think this is weird that null equals to empty collection.

@sunxiaojian
Copy link
Collaborator Author

sunxiaojian commented Mar 10, 2025

Member

Actually I think this is weird that null equals to empty collection.

@jerqi Then let's replace it

public boolean safeIsEqualCollection(Collection<?> list1, Collection<?> list2) {
    if (list1 == list2) {
        return true;
    }
    if (list1 == null || list2 == null) {
        return false;
    }
    return CollectionUtils.isEqualCollection(list1, list2);
}

@yuqi1129
Copy link
Contributor

@sunxiaojian could you help to check if this issue can solve the https://github.com/apache/gravitino/pull/6455/files#r1955682884 by the way?

@sunxiaojian
Copy link
Collaborator Author

@sunxiaojian could you help to check if this issue can solve the https://github.com/apache/gravitino/pull/6455/files#r1955682884 by the way?

@yuqi1129 Solved it, I removed this code.

@sunxiaojian
Copy link
Collaborator Author

@yuqi1129 @jerqi fixed all, PTAL.

@yuqi1129 yuqi1129 requested a review from jerqi March 11, 2025 06:47
jerqi
jerqi previously approved these changes Mar 11, 2025
@yuqi1129
Copy link
Contributor

@sunxiaojian
Could you please resolve the conflict?

@yuqi1129 yuqi1129 merged commit fdcb7ae into apache:main Mar 11, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug report] Possible error in the equals method for collection
3 participants